package org.test.myTree;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.test.common.ModelConstant;


@Entity
@Table(name = "TB_DEPARTMENT", catalog = ModelConstant.DB_CATALOG, schema = ModelConstant.DB_SCHEMA)
public class TbDepartment implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "tbDepartmentId", nullable = false, unique = true, length = ModelConstant.STRING_LENGHT_id)
	private String tbDepartmentId;

	@Column(name = "tbDepartmentName", nullable = false, length = ModelConstant.STRING_LENGHT_name)
	private String tbDepartmentName;

	@Column(name = "isEnable", nullable = false)
	private boolean isEnable;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "parentDepartment")
	private TbDepartment parentDepartment;

	public String getTbDepartmentId() {
		return tbDepartmentId;
	}

	public void setTbDepartmentId(String tbDepartmentId) {
		this.tbDepartmentId = tbDepartmentId;
	}

	public String getTbDepartmentName() {
		return tbDepartmentName;
	}

	public void setTbDepartmentName(String tbDepartmentName) {
		this.tbDepartmentName = tbDepartmentName;
	}

	public boolean isEnable() {
		return isEnable;
	}

	public void setEnable(boolean isEnable) {
		this.isEnable = isEnable;
	}

	public TbDepartment getParentDepartment() {
		return parentDepartment;
	}

	public void setParentDepartment(TbDepartment parentDepartment) {
		this.parentDepartment = parentDepartment;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
